package com.jrx.anytxn.customer.plugins;


/**
 * @description 记录历史信息helper
 * @author: zhenghaopu
 * @date: 2019/8/27 19:09
 */
public class HistoryLogHelper {
    private static final ThreadLocal<HistoryLog> LOCAL_HISTORY = new ThreadLocal<>();

    public static void setLocalHistory(HistoryLog txnHistoryLog) {
        LOCAL_HISTORY.set(txnHistoryLog);
    }

    public static HistoryLog getLocalHistory() {
        return LOCAL_HISTORY.get();
    }

    /**
     * 移除本地变量
     */
    public static void clearLocalHistory() {
        LOCAL_HISTORY.remove();
    }
}
